Skip to content

Conversation

dgrothaus-ku
Copy link

The reference to $output was overwritten by nodes not covered by the switch construct.

Example to test:

<root>
  <Nodes>
    <Node One="1" Two="2" />
    <Node Two="2" Three="3" />
            <!-- Content omitted -->
    <Node Three="3" Four="4" />
  </Nodes>
</root>

Array without patch:

[
  'root' => [
    'Nodes' => [
      'Node' => [
        '@value'    => '',
        '@attributes' => [
          'Three' => '3',
          'Four'  => '4',
        ],
      ],
    ],
  ],
];

Array with patch:

[
  'root' => [
    'Nodes' => [
      'Node' => [
        0 => [
          '@value'    => '',
          '@attributes' => [
            'One' => '1',
            'Two' => '2',
          ],
        ],
        1 => [
          '@value'    => '',
          '@attributes' => [
            'Two'   => '2',
            'Three' => '3',
          ],
        ],
        2 => [
          '@value'    => '',
          '@attributes' => [
            'Three' => '3',
            'Four'  => '4',
          ],
        ],
      ],
    ],
  ],
];

The reference to $output was overwritten by nodes not covered by the switch construct.

Example to test:
```xml
<root>
  <Nodes>
    <Node One="1" Two="2" />
    <Node Two="2" Three="3" />
            <!-- Content omitted -->
    <Node Three="3" Four="4" />
  </Nodes>
</root>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant